#ifndef TCPCONNECTION_H
#define TCPCONNECTION_H
#include "noncopyable.hpp"
#include "inetaddress.hpp"
#include "socket.hpp"
#include "socketio.hpp"
#include <string>
using std::string;
namespace moqi
{
class TcpConnection:Noncopyable
{
public:
    TcpConnection(int fd);
    ~TcpConnection();
    void send(const string& msg)const;
    string recv();
    void shutdown();
    bool isClosed();
    string status();

    InetAddress getLocalAddr();
    InetAddress getPeerAddr();
private:
    Socket _sock;
    SocketIO _sockio;
    InetAddress _localAddr;
    InetAddress _peerAddr;
};

}

#endif

